import time
products = [['iphone',6888],['MacPro',14800],['小米6',2499],['Coffee',34],['Book',60],['Nike',699]]
shop_car = []
shop_cost = []
price = 0
for i in products:
    print(i[0])
    commit = input('请输入你要购买的物品')
    if commit == i[0]:
        shop_car.append(i)
        shop_cost.append(i)
    if commit != i[0]:
        print('![img](http://p.qpic.cn/homework/0/hw_h_4ty9yul3h9mo4ks5fbc663c1a65b/)')

while True:
    com1 = input("如需退出请按'q'")
    if com1 =='q':
        for j in shop_cost:
            price += j[1]
            print(j)
        print('合计金额：',price)
        time.sleep(15)
        break
    else:
        print('您输入的命令有误')
